package com.fwj.core.common.constant;

/**
 * @Author: fwj
 * @Data: 2022/4/23 2:51
 * @Version 1.0
 * @Description:
 */


public enum AccountConstant {

    PHONE("Phone","手机号"),
    EMAIL_163("163.com","163网易邮箱"),
    EMAIL_QQ("qq.com","QQ邮箱"),
    EMAIL_139("139.com","139(中国移动)邮箱"),
    EMAIL_SOHO("sohu.com","sohu(搜狐)邮箱"),
    EMAIL_ALIYUN("aliyun.com","aliyun(阿里云)邮箱"),
    EMAIL_189("189.com","189邮箱"),
    EMAIL_HOTMAIL("hotmail.com","hotmail(微软)邮箱"),
    EMAIL_GMAIL("gmail.com","Gmail(谷歌)邮箱"),
    EMAIL_SINA("sina.com","Sina(新浪)邮箱"),
    EMAIL_UNKNOWN("Unknown","未知邮箱"),
    ;
    private final String typeSub;

    private final String description;

    AccountConstant(String typeSub, String description) {
        this.typeSub = typeSub;
        this.description = description;
    }

    public String getTypeSub() {
        return typeSub;
    }

    public String getDescription() {
        return description;
    }

    public static AccountConstant getAccountType(String typeSub){
        for (AccountConstant accountConstant: AccountConstant.values()){
            if (accountConstant.getTypeSub().equals(typeSub)){
                return accountConstant;
            }
        }
        return EMAIL_UNKNOWN;
    }

}
